<template>
  <div>
    <el-card class="cardBox">
      <div class="title">
        <!-- 浮动文本 -->
        <h1 class="">104、105皮带参数</h1>
        <el-button @click="alarmBtn">报警总数：0</el-button>
      </div>

      <div style="display: flex">
        <div style="flex: 1; margin-right: 10px">
          <div style="border: 1px solid var(--el-border-color-light)">
            <el-row class="header-row">
              <el-col :span="8"></el-col>
              <el-col :span="8" class="title-col">
                <span>104皮带参数</span>
              </el-col>
              <el-col :span="8" class="status-col">
                <!-- <div class="status-container">
              <div>
                <span>通讯故障</span>
                <i class="yuan yellow"></i>
              </div>
              <div>
                <span>无故障</span>
                <i class="yuan grey"></i>
              </div>
              <div>
                <span>运行</span>
                <i class="yuan green"></i>
              </div>
              <div>
                <span>报警</span>
                <i class="yuan red"></i>
              </div>
            </div> -->
              </el-col>
            </el-row>

            <el-row class="threeTitle">
              <el-col :span="6">项目</el-col>
              <el-col :span="2">状态值</el-col>
              <el-col :span="6">项目</el-col>
              <el-col :span="2">状态值</el-col>
              <el-col :span="6">项目</el-col>
              <el-col :span="2">状态值</el-col>
            </el-row>
            <el-row>
              <el-col :span="6">运行频率（HZ）</el-col>
              <el-col :span="2">XXX</el-col>
              <el-col :span="6">电机A相温度（℃）</el-col>
              <el-col :span="2">XXX</el-col>
              <el-col :span="6">IGBT温度（℃）</el-col>
              <el-col :span="2">XXX</el-col>
            </el-row>
            <el-row>
              <el-col :span="6">电机电流（A）</el-col>
              <el-col :span="2">XXX</el-col>
              <el-col :span="6">电机B相温度（℃）</el-col>
              <el-col :span="2">XXX</el-col>
              <el-col :span="6">滚筒前轴温度（℃）</el-col>
              <el-col :span="2">XXX</el-col>
            </el-row>
            <el-row>
              <el-col :span="6">运行速度（m/s）</el-col>
              <el-col :span="2">XXX</el-col>
              <el-col :span="6">电机C相温度（℃）</el-col>
              <el-col :span="2">XXX</el-col>
              <el-col :span="6">滚筒后轴温度（℃）</el-col>
              <el-col :span="2">XXX</el-col>
            </el-row>
            <el-row>
              <el-col :span="6">输出功率（KW）</el-col>
              <el-col :span="2">XXX</el-col>
              <el-col :span="6"></el-col>
              <el-col :span="2"></el-col>
              <el-col :span="6"></el-col>
              <el-col :span="2"></el-col>
            </el-row>
            <el-row>
              <el-col :span="6">变频器运行状态</el-col>
              <el-col :span="2"
                ><div
                  class="indicator-light"
                  :class="
                    NamePD_104('Belt104InvRunSts_DI', operator.NO).value
                      ? 'green'
                      : 'grey'
                  "
                ></div
              ></el-col>
              <el-col :span="6">变频器故障回馈</el-col>
              <el-col :span="2"
                ><div
                  class="indicator-light"
                  :class="
                    NamePD_104('Belt104InvFaultFeed_DI', operator.NO).value
                      ? 'red'
                      : 'grey'
                  "
                ></div
              ></el-col>
              <el-col :span="6">华宁沿线闭锁</el-col>
              <el-col :span="2"
                ><div
                  class="indicator-light"
                  :class="
                    NamePD_104_PT_104(
                      'PT104104BeltHNLockReleaseSts_DI',
                      operator.NO
                    ).value
                      ? 'red'
                      : 'grey'
                  "
                ></div
              ></el-col>
            </el-row>
            <el-row>
              <el-col :span="6">电机冷却风机运行</el-col>
              <el-col :span="2"
                ><div
                  class="indicator-light"
                  :class="
                    NamePD_104('Belt104MotCoolFanRun_DI', operator.NO).value
                      ? 'green'
                      : 'grey'
                  "
                ></div
              ></el-col>
              <el-col :span="6">电机冷却风机故障</el-col>
              <el-col :span="2"
                ><div
                  class="indicator-light"
                  :class="
                    NamePD_104('xxxxxxxx', operator.NO).value ? 'green' : 'grey'
                  "
                ></div
              ></el-col>
              <el-col :span="6">就地箱急停</el-col>
              <el-col :span="2"
                ><div
                  class="indicator-light"
                  :class="
                    NamePD_104('Belt104LocalBoxEmergStop_DI', operator.NO).value
                      ? 'red'
                      : 'grey'
                  "
                ></div
              ></el-col>
            </el-row>
            <el-row>
              <el-col :span="6">电机冷却水泵运行</el-col>
              <el-col :span="2"
                ><div
                  class="indicator-light"
                  :class="
                    NamePD_104('Belt104MotCoolWaterPumpRun_DI', operator.NO)
                      .value
                      ? 'green'
                      : 'grey'
                  "
                ></div
              ></el-col>
              <el-col :span="6">电机冷却水泵故障</el-col>
              <el-col :span="2"
                ><div
                  class="indicator-light"
                  :class="
                    NamePD_104('xxxxxxxx', operator.NO).value ? 'green' : 'grey'
                  "
                ></div
              ></el-col>
              <el-col :span="6">华宁运行状态</el-col>
              <el-col :span="2"
                ><div
                  class="indicator-light"
                  :class="
                    NamePD_104_PT_104(
                      'PT104104BeltHNRUNReleaseSts_DI',
                      operator.NO
                    ).value
                      ? 'red'
                      : 'grey'
                  "
                ></div
              ></el-col>
            </el-row>
            <el-row>
              <el-col :span="6">华宁备妥信号</el-col>
              <el-col :span="2"
                ><div
                  class="indicator-light"
                  :class="
                    NamePD_104_PT_104_GEN(
                      'PT104104BeltHNReadyReleaseSts_DI',
                      operator.NO
                    ).value
                      ? 'red'
                      : 'grey'
                  "
                ></div
              ></el-col>
              <el-col :span="6"></el-col>
              <el-col :span="2"></el-col>
              <el-col :span="6"></el-col>
              <el-col :span="2"></el-col>
            </el-row>
            <el-row>
              <el-col :span="6" class="huaning-title">华宁保护</el-col>
              <el-col :span="18">
                <div class="hn-container">
                  <span
                    >一级跑偏保护<span class="hn-span"
                      ><div
                        class="indicator-light"
                        :class="
                          NamePD_104_PT_104(
                            'PT104104Belt1stDeviation1EnableSts_DI',
                            operator.NO
                          ).value ||
                          NamePD_104_PT_104(
                            'PT104104Belt1stDeviation2EnableSts_DI',
                            operator.NO
                          ).value ||
                          NamePD_104_PT_104(
                            'PT104104Belt1stDeviation3EnableSts_DI',
                            operator.NO
                          ).value ||
                          NamePD_104_PT_104(
                            'PT104104Belt1stDeviation4EnableSts_DI',
                            operator.NO
                          ).value
                            ? 'red'
                            : 'grey'
                        "
                      ></div></span
                  ></span>
                  <span
                    >二级跑偏保护<span class="hn-span"
                      ><div
                        class="indicator-light"
                        :class="
                          NamePD_104_PT_104(
                            'PT104104Belt2ndDeviation1EnableSts_DI',
                            operator.NO
                          ).value ||
                          NamePD_104_PT_104(
                            'PT104104Belt2ndDeviation2EnableSts_DI',
                            operator.NO
                          ).value ||
                          NamePD_104_PT_104(
                            'PT104104Belt2ndDeviation3EnableSts_DI',
                            operator.NO
                          ).value ||
                          NamePD_104_PT_104(
                            'PT104104Belt2ndDeviation4EnableSts_DI',
                            operator.NO
                          ).value
                            ? 'red'
                            : 'grey'
                        "
                      ></div></span
                  ></span>
                  <span
                    >堆煤保护<span class="hn-span"
                      ><div
                        class="indicator-light"
                        :class="
                          NamePD_104_PT_104(
                            'PT104104BeltCoalPileReleaseSts_DI',
                            operator.NO
                          ).value
                            ? 'red'
                            : 'grey'
                        "
                      ></div></span
                  ></span>
                  <span
                    >烟雾保护<span class="hn-span"
                      ><div
                        class="indicator-light"
                        :class="
                          NamePD_104_PT_104(
                            'PT104104BeltSmokeReleaseSts_DI',
                            operator.NO
                          ).value
                            ? 'red'
                            : 'grey'
                        "
                      ></div></span
                  ></span>
                  <span
                    >纵撕保护<span class="hn-span"
                      ><div
                        class="indicator-light"
                        :class="
                          NamePD_104_PT_104(
                            'PT104104BeltLongTearEnableSts_DI',
                            operator.NO
                          ).value
                            ? 'red'
                            : 'grey'
                        "
                      ></div></span
                  ></span>
                  <span
                    >温度保护（无点）<span class="hn-span"
                      ><div
                        class="indicator-light"
                        :class="
                          NamePD_104('xxxxxxxx', operator.NO).value
                            ? 'green'
                            : 'grey'
                        "
                      ></div></span
                  ></span>
                  <span
                    >速度保护<span class="hn-span"
                      ><div
                        class="indicator-light"
                        :class="
                          !(
                            NamePD_101_GEN(
                              'StatusBeltSpeed_104Belt_AI',
                              operator.Divide,
                              1000
                            ).value > 5.12 ||
                            NamePD_101_GEN(
                              'StatusBeltSpeed_104Belt_AI',
                              operator.Divide,
                              1000
                            ).value < 1.75
                          )
                            ? 'red'
                            : 'grey'
                        "
                      ></div></span
                  ></span>
                </div>
              </el-col>
            </el-row>
          </div>
          <div style="margin-top: 10px">
            <span>摄像头</span>
            <span
              >皮带速度
              {{
                NamePD_101_GEN(
                  "StatusBeltSpeed_104Belt_AI",
                  operator.Divide,
                  1000,
                  2
                )
              }}
              m/s</span
            >
          </div>

          <div style="">
            <img
              src="@/assets/images/belt1.png"
              style="width: 100%; height: 100px"
            />
          </div>
        </div>
        <div style="flex: 1; margin-left: 10px">
          <div style="border: 1px solid var(--el-border-color-light)">
            <el-row class="header-row">
              <el-col :span="8"></el-col>
              <el-col :span="8" class="title-col">
                <span>105皮带参数</span>
              </el-col>
              <el-col :span="8" class="status-col"> </el-col>
            </el-row>

            <el-row class="threeTitle">
              <el-col :span="6">项目</el-col>
              <el-col :span="2">状态值</el-col>
              <el-col :span="6">项目</el-col>
              <el-col :span="2">状态值</el-col>
              <el-col :span="6">项目</el-col>
              <el-col :span="2">状态值</el-col>
            </el-row>
            <el-row>
              <el-col :span="6">运行频率（HZ）</el-col>
              <el-col :span="2">XXX</el-col>
              <el-col :span="6">电机A相温度（℃）</el-col>
              <el-col :span="2">XXX</el-col>
              <el-col :span="6">IGBT温度（℃）</el-col>
              <el-col :span="2">XXX</el-col>
            </el-row>
            <el-row>
              <el-col :span="6">电机电流（A）</el-col>
              <el-col :span="2">XXX</el-col>
              <el-col :span="6">电机B相温度（℃）</el-col>
              <el-col :span="2">XXX</el-col>
              <el-col :span="6">滚筒前轴温度（℃）</el-col>
              <el-col :span="2">XXX</el-col>
            </el-row>
            <el-row>
              <el-col :span="6">运行速度（m/s）</el-col>
              <el-col :span="2">XXX</el-col>
              <el-col :span="6">电机C相温度（℃）</el-col>
              <el-col :span="2">XXX</el-col>
              <el-col :span="6">滚筒后轴温度（℃）</el-col>
              <el-col :span="2">XXX</el-col>
            </el-row>
            <el-row>
              <el-col :span="6">输出功率（KW）</el-col>
              <el-col :span="2">XXX</el-col>
              <el-col :span="6"></el-col>
              <el-col :span="2"></el-col>
              <el-col :span="6"></el-col>
              <el-col :span="2"></el-col>
            </el-row>
            <el-row>
              <el-col :span="6">变频器运行状态</el-col>
              <el-col :span="2"
                ><div
                  class="indicator-light"
                  :class="
                    NamePD_104('Belt105InvRunSts_DI', operator.NO).value
                      ? 'green'
                      : 'grey'
                  "
                ></div
              ></el-col>
              <el-col :span="6">变频器故障回馈</el-col>
              <el-col :span="2"
                ><div
                  class="indicator-light"
                  :class="
                    NamePD_104('Belt105InvFaultFeed_DI', operator.NO).value
                      ? 'red'
                      : 'grey'
                  "
                ></div
              ></el-col>
              <el-col :span="6">华宁沿线闭锁</el-col>
              <el-col :span="2"
                ><div
                  class="indicator-light"
                  :class="
                    NamePD_104_PT_104(
                      'PT104105BeltHNLockReleaseSts_DI',
                      operator.NO
                    ).value
                      ? 'red'
                      : 'grey'
                  "
                ></div
              ></el-col>
            </el-row>
            <el-row>
              <el-col :span="6">电机冷却风机运行</el-col>
              <el-col :span="2"
                ><div
                  class="indicator-light"
                  :class="
                    NamePD_104('Belt105MotCoolFanRun_DI', operator.NO).value
                      ? 'green'
                      : 'grey'
                  "
                ></div
              ></el-col>
              <el-col :span="6">电机冷却风机故障</el-col>
              <el-col :span="2"
                ><div
                  class="indicator-light"
                  :class="
                    NamePD_104('xxxxxxxx', operator.NO).value ? 'green' : 'grey'
                  "
                ></div
              ></el-col>
              <el-col :span="6">就地箱急停</el-col>
              <el-col :span="2"
                ><div
                  class="indicator-light"
                  :class="
                    NamePD_104('Belt105MotCoolWaterPumpRun_DI', operator.NO)
                      .value
                      ? 'green'
                      : 'grey'
                  "
                ></div
              ></el-col>
            </el-row>
            <el-row>
              <el-col :span="6">电机冷却水泵运行</el-col>
              <el-col :span="2"
                ><div
                  class="indicator-light"
                  :class="
                    NamePD_104('xxxxxxxx', operator.NO).value ? 'green' : 'grey'
                  "
                ></div
              ></el-col>
              <el-col :span="6">电机冷却水泵故障</el-col>
              <el-col :span="2"
                ><div
                  class="indicator-light"
                  :class="
                    NamePD_104('xxxxxxxx', operator.NO).value ? 'green' : 'grey'
                  "
                ></div
              ></el-col>
              <el-col :span="6">华宁运行状态</el-col>
              <el-col :span="2"
                ><div
                  class="indicator-light"
                  :class="
                    NamePD_104_PT_104(
                      'PT104105BeltHNRUNReleaseSts_DI',
                      operator.NO
                    ).value
                      ? 'red'
                      : 'grey'
                  "
                ></div
              ></el-col>
            </el-row>
            <el-row>
              <el-col :span="6">华宁备妥信号</el-col>
              <el-col :span="2"
                ><div
                  class="indicator-light"
                  :class="
                    NamePD_104_PT_104_GEN(
                      'PT104105BeltHNReadyReleaseSts_DI',
                      operator.NO
                    ).value
                      ? 'red'
                      : 'grey'
                  "
                ></div
              ></el-col>
              <el-col :span="6"></el-col>
              <el-col :span="2"></el-col>
              <el-col :span="6"></el-col>
              <el-col :span="2"></el-col>
            </el-row>
            <el-row>
              <el-col :span="6" class="huaning-title">华宁保护</el-col>
              <el-col :span="18">
                <div class="hn-container">
                  <span
                    >一级跑偏保护<span class="hn-span"
                      ><div
                        class="indicator-light"
                        :class="
                          NamePD_104_PT_104(
                            'PT104105Belt1stDeviation1EnableSts_DI',
                            operator.NO
                          ).value ||
                          NamePD_104_PT_104(
                            'PT104105Belt1stDeviation2EnableSts_DI',
                            operator.NO
                          ).value ||
                          NamePD_104_PT_104(
                            'PT104105Belt1stDeviation3EnableSts_DI',
                            operator.NO
                          ).value ||
                          NamePD_104_PT_104(
                            'PT104105Belt1stDeviation4EnableSts_DI',
                            operator.NO
                          ).value
                            ? 'red'
                            : 'grey'
                        "
                      ></div></span
                  ></span>
                  <span
                    >二级跑偏保护<span class="hn-span"
                      ><div
                        class="indicator-light"
                        :class="
                          NamePD_104_PT_104(
                            'PT104105Belt2ndDeviation1EnableSts_DI',
                            operator.NO
                          ).value ||
                          NamePD_104_PT_104(
                            'PT104105Belt2ndDeviation2EnableSts_DI',
                            operator.NO
                          ).value ||
                          NamePD_104_PT_104(
                            'PT104105Belt2ndDeviation3EnableSts_DI',
                            operator.NO
                          ).value ||
                          NamePD_104_PT_104(
                            'PT104105Belt2ndDeviation4EnableSts_DI',
                            operator.NO
                          ).value
                            ? 'red'
                            : 'grey'
                        "
                      ></div></span
                  ></span>
                  <span
                    >堆煤保护<span class="hn-span"
                      ><div
                        class="indicator-light"
                        :class="
                          NamePD_104_PT_104(
                            'PT104105BeltCoalPileReleaseSts_DI',
                            operator.NO
                          ).value
                            ? 'red'
                            : 'grey'
                        "
                      ></div></span
                  ></span>
                  <span
                    >烟雾保护<span class="hn-span"
                      ><div
                        class="indicator-light"
                        :class="
                          NamePD_104_PT_104(
                            'PT104105BeltSmokeReleaseSts_DI',
                            operator.NO
                          ).value
                            ? 'red'
                            : 'grey'
                        "
                      ></div></span
                  ></span>
                  <span
                    >纵撕保护<span class="hn-span"
                      ><div
                        class="indicator-light"
                        :class="
                          NamePD_104_PT_104(
                            'PT104105BeltLongTearEnableSts_DI',
                            operator.NO
                          ).value
                            ? 'red'
                            : 'grey'
                        "
                      ></div></span
                  ></span>
                  <span
                    >温度保护<span class="hn-span"
                      ><div
                        class="indicator-light"
                        :class="
                          NamePD_104('xxxxxxxx', operator.NO).value
                            ? 'green'
                            : 'grey'
                        "
                      ></div></span
                  ></span>
                  <span
                    >速度保护<span class="hn-span"
                      ><div
                        class="indicator-light"
                        :class="
                          !(
                            NamePD_101_GEN(
                              'StatusBeltSpeed_105Belt_AI',
                              operator.Divide,
                              1000
                            ).value > 5.12 ||
                            NamePD_101_GEN(
                              'StatusBeltSpeed_105Belt_AI',
                              operator.Divide,
                              1000
                            ).value < 1.75
                          )
                            ? 'red'
                            : 'grey'
                        "
                      ></div></span
                  ></span>
                </div>
              </el-col>
            </el-row>
          </div>
          <div style="margin-top: 10px">
            <span>摄像头</span>
            <span
              >皮带速度
              {{
                NamePD_101_GEN(
                  "StatusBeltSpeed_105Belt_AI",
                  operator.Divide,
                  1000,
                  2
                )
              }}
              m/s</span
            >
          </div>

          <div style="">
            <img
              src="@/assets/images/belt1.png"
              style="width: 100%; height: 100px"
            />
          </div>
        </div>
      </div>

      <div style="display: flex; justify-content: end; margin-top: 0px">
        <el-button @click="sensorBtn">104、105 传感器参数</el-button>
        <el-button @click="switchBtn">组合开关</el-button>
      </div>
    </el-card>

    <!-- 公司log -->
    <el-row>
      <div class="kx-log-box">
        <img
          class="kx-img"
          src="@/assets/images/kxauto.png"
          alt="描述图片的文字"
        />
        <span>开轩自动化</span>

        <span class="kx-hezuo">
          商务合作：18509234888（同微信） 技术支持：18691805301（同微信）
        </span>
      </div>
    </el-row>

    <!-- 弹窗 -->
    <form-dialog ref="formRef" />
    <sensorFormDialog ref="sensorRef" />
    <CoalCutterHeadSwitch ref="coalCutterHeadSwitchRef" />
  </div>
</template>

<script setup lang="ts">
import formDialog from "./alarmForm.vue";
import { ref, computed } from "vue";
import sensorFormDialog from "./sensorForm.vue";
import CoalCutterHeadSwitch from "./coalCutterHeadSwitch.vue";
import { act, createWebSocket } from "@/utils/websocket"; //引入websocket

import { operator } from "@/utils/op_enums";
import {
  NamePD_104,
  NamePD_104_PT_104,
  NamePD_104_PT_104_GEN,
  NamePD_101_GEN,
} from "@/utils/beltPositioningMethod.ts";

const formRef = ref();
const sensorRef = ref();
const coalCutterHeadSwitchRef = ref();
const alarmBtn = () => {
  formRef.value.openDialog();
};

const sensorBtn = () => {
  sensorRef.value.openDialog();
};
const switchBtn = () => {
  coalCutterHeadSwitchRef.value.openDialog();
};
// const getColor = (value: any) => {
//   return equipmentParametersColorMap[value];
// };

// const NamePD_104 = (
//   key: string,
//   op: operator,
//   op_number?: number,
//   retain?: number
// ) =>
//   computed(() => {
//     return useTagResults(act.PD_104_105.PD_104[key], op, op_number, retain);
//   });
</script>

<style lang="scss" scoped>
.cardBox {
  background-color: var(--el-bg-color);
  border-radius: 8px;
  box-shadow: var(--el-box-shadow-light);
  border: 1px solid var(--el-border-color-light);

  /* 左上方标题 */
  .title {
    border-bottom: 1px solid var(--el-border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    h1 {
      color: var(--el-text-color-primary);
      font-size: 20px;
      margin: 0;
      font-weight: 500;
    }

    .el-button {
      background-color: var(--el-color-danger);
      color: var(--el-color-white);
      border: none;
      border-radius: 4px;
      padding: 8px 15px;
      font-weight: 500;

      &:hover {
        background-color: var(--el-color-danger-light-3);
      }
    }
  }

  /* 表格标题 + 四个指示灯 */
  .header-row {
    display: flex;
    align-items: center;
    background-color: var(--el-fill-color-lighter);
    font-weight: 500;
    color: var(--el-text-color-primary);
    padding: 10px;
    .el-col {
      height: 40px;
      display: flex;
      align-items: center;
      border: 1px solid transparent;
    }

    .title-col {
      justify-content: center;

      span {
        font-size: 18px;
      }
    }

    .status-col {
      justify-content: end;
      .status-container {
        display: flex;
        gap: 14px;

        div {
          background: var(--el-fill-color-blank);
          border: 1px solid var(--el-border-color-lighter);
          border-radius: 4px;
          padding: 4px 8px;
          display: flex;
          align-items: center;
          gap: 6px;
          font-size: 13px;

          span {
            padding: 0 4px;
          }

          .yuan {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            flex-shrink: 0;
            @extend %status-colors;
          }
        }
      }
    }
  }

  /* 表格的标题 项目 + 状态值 */
  .threeTitle {
    .el-col {
      background-color: var(--el-fill-color) !important;
    }
  }

  /* 每一小格子的边框 背景色 */
  .el-col {
    border: 1px solid var(--el-border-color-lighter);
    text-align: center;
    padding: 6px 5px;
    font-size: 13px;
    color: var(--el-text-color-regular);

    &:first-child,
    &:nth-child(3),
    &:nth-child(5) {
      font-weight: 500;
      color: var(--el-text-color-primary);
      background-color: var(--el-fill-color-lighter);
    }
  }

  /* 子页面设备参数--指示灯 */
  .indicator-light {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--el-border-color);
    margin: 0 auto;
    @extend %status-colors;
  }

  /* 华宁沿线闭锁 */
  .huaning-title {
    display: flex;
    align-items: center;
    justify-content: center;
    // height: 100%;
    color: var(--el-text-color-primary);
    font-weight: 500;
  }

  .hn-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 8px;
    align-items: center;
    background-color: var(--el-fill-color-lighter);
    border-radius: 4px;

    span {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .hn-span {
      display: inline-flex;
      align-items: center;
    }
  }

  .index-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    justify-content: flex-start;
    background-color: var(--el-fill-color-lighter);
    border-radius: 4px;
    min-height: 40px;
    align-items: center;
  }

  .index-circle {
    width: 26px;
    height: 26px;
    background-color: var(--el-border-color);
    border-radius: 50%;
    color: var(--el-text-color-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: 500;
    @extend %status-colors;
  }

  .terminal-voltage {
    color: var(--el-color-warning);
    margin-left: 20px;
    font-size: 13px;
  }

  // 定义基础颜色类（只定义一次）
  %status-colors {
    &.green {
      background-color: var(--el-color-success);
    }
    &.red {
      background-color: var(--el-color-danger);
    }
    &.yellow {
      background-color: var(--el-color-warning);
    }
    &.grey {
      background-color: var(--el-border-color-dark); // 比默认边框色更深的灰色
    }
  }
}
</style>
